home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / VGADOC4B.ZIP / AI.TXT < prev    next >
Text File  |  1995-09-29  |  56KB  |  1,229 lines

  1. The Adapter Interface (AI) was introduced as the programming interface for the
  2. IBM 8514/A before the register interface was publicly available.
  3. AI interfaces have also been implemented for the XGA, IBM Image Adapter/A and
  4. 8514/A clones like the ATI Mach8/32
  5. Also pure software versions exists like Tseng's RIXAI.
  6.  
  7. INT 7F - AI - Check for Adapter Interface
  8.          AX = 0105h
  9.          CX = 0000h
  10.          DX = 0000h
  11. Return: Carry clear if successful
  12.         CX:DX -> Function table. One DWORD pointer for each function (0..60)
  13.                  Most functions have one parameter (Shown as X below), a
  14.                  pointer to a parameter table where the first WORD holds the
  15.                  number of bytes following, thus if there are 10 bytes in all
  16.                  the first WORD will be 8. It is the callers responsibility to
  17.                  set this.
  18.  
  19. function 00h HLINE(X) - Line at Given Point
  20.  Draws a polyline starting in the first position listed.
  21.  Parameter Block:
  22.  Offset: Type:   Description:
  23.    00h   WORD    Length of data following(4*Number_of_points)
  24.    02h   WORD    X-coordinate of 1st point
  25.    04h   WORD    Y-coordinate of 1st point
  26.       ...
  27.   4*n+2  WORD    X-coordinate of Nth point
  28.   4*n+4  WORD    Y-coordinate of Nth point
  29.  
  30. function 01h HCLINE(X) - Line at Current Position
  31.  Draws a polyline from the current position to the last point
  32.  Parameter Block:
  33.  Offset: Type:   Description:
  34.    00h   WORD    Length of data following(4*Number_of_points)
  35.    02h   WORD    X-coordinate of 1st point
  36.    04h   WORD    Y-coordinate of 1st point
  37.       ...
  38.   4*n+2  WORD    X-coordinate of Nth point
  39.   4*n+4  WORD    Y-coordinate of Nth point
  40.  
  41. function 02h HRLINE(X) - Relative Line at Given Position
  42.  Draws a series of polylines, starting at the given point, with each endpoint
  43.  given as an offset from the last point.
  44.  Parameter Block:
  45.  Offset: Type:   Description:
  46.    00h   WORD    Length of data following(4 + 2*Number_of_points)
  47.    02h   WORD    X-coordinate of starting point
  48.    04h   WORD    Y-coordinate of starting point
  49.       .....
  50.   2*N+4  BYTE    X-coordinate of Nth relative point
  51.   2*N+5  BYTE    Y-coordinate of Nth relative point
  52.  
  53.  
  54. function 03h HCRLINE(X) - Relative Line at Current Position
  55.  Draws a series of linesegments, each specified relative to the end of the
  56.  previous segment (the current position for the first segment).
  57.  Parameter Block:
  58.  Offset: Type:   Description:
  59.    00h   WORD    Length of data following(2*Number of segments)
  60.  
  61.   2*N+2  BYTE    X-coordinate offset (-128 to +127)
  62.   2*N+3  BYTE    Y-coordinate offset (-128 to +127)
  63.  
  64. function 04h HSCP(X) - Set Current Position
  65.  Sets the current drawing position
  66.  Parameter Block:
  67.  Offset: Type:   Description:
  68.    00h   WORD    Length of data following(4)
  69.    02h   WORD    New X-coordinate
  70.    04h   WORD    New Y-coordinate
  71.  
  72. function 05h HBAR(X) - Begin Area
  73.  Marks the start of a series of commands that defines the boundary for a
  74.  fill area. The sequence is terminated by a HEAR() command.
  75.  The following commands are not allowed between the HBAR and HEAR:
  76.    HOPEN, HCLOSE, HSMODE, HSHS, HSCMP, HSBP, HCHST and HCCHST.
  77.  Parameter Block:
  78.  Offset: Type:   Description:
  79.    00h   WORD    Length of data following(0)
  80. Note: HBAR/HEAR commands can not be nested.
  81.  
  82. function 06h HEAR(X) - End Area
  83.  Ends the area definition started by a HBAR command.
  84.  Parameter Block:
  85.  Offset: Type:   Description:
  86.    00h   WORD    Length of data following(0 or 1)
  87.    02h   BYTE    Flag (only if length is 1):
  88.                   00h  Fill the defined area
  89.                   40h  Suspend the area definition. until the next HBAR
  90.                   80h  Abort definition.
  91.                  Note: bits 0-5 are probably ignored
  92.  
  93. function 07h HSCOL(X) - Set Color
  94.  Sets the foreground color
  95.  Parameter Block:
  96.  Offset: Type:   Description:
  97.    00h   WORD    Length of data following(4)
  98.    02h   DWORD   Foreground color index. Only the number of least significant
  99.                  bits (depending on the current mode) are used.
  100.                  0FFFFFFFFh is reserved for multiplane character sets
  101.  
  102. function 08h HOPEN(X) - Open Adapter
  103.  Enables the adapter.
  104.  Parameter Block:
  105.  Offset: Type:   Description:
  106.    00h   WORD    Length of data following(3)
  107.    02h   BYTE    Initialisation flags
  108.                  Bit 0-5  Don't care
  109.                        6  Clear to load default palette
  110.                        7  Clear to clear video memory
  111.    03h   BYTE    Mode. See HSMODE for (implementation specific) modelist.
  112.    04h   BYTE    Return status. In the original 8514/A a non-zero return value
  113.                  indicated failure, later version have assigned bits to
  114.                  specific events:
  115.                  Bit 7  Set if a driver/hardware mismatch occours
  116.                      6  Set if a control program reject occours
  117.  
  118. function 09h HSMX(X) - Set Mix
  119.  Sets the fore- and background mixes
  120.  Parameter Block:
  121.  Offset: Type:   Description:
  122.    00h   WORD    Length of data following(2)
  123.    02h   BYTE    Foreground mix (SRC is Source, DST is Destination):
  124.                   00h:  Keep previous mix
  125.                   01h:  SRC or DST
  126.                   02h:  SRC
  127.                   03h:  Reserved
  128.                   04h:  SRC xor DST
  129.                   05h:  DST          (I.e. do nothing)
  130.                   06h:  Max(DST,SRC)
  131.                   07h:  Min(DST,SRC)
  132.                   08h:  SRC+DST  (overflow is clipped to maximum)
  133.                   09h:  DST-SRC  (underflow is clipped to zero)
  134.                   0Ah:  SRC-DST  (underflow is clipped to zero)
  135.                   0Bh:  (SRC+DST)/2  (Average)
  136.               0Ch-0Fh:  Reserved
  137.                   10h:  Zero, all bits cleared
  138.                   11h:  SRC and DST
  139.                   12h:  SRC and (not DST)
  140.                   13h:  SRC
  141.                   14h:  (not SRC) and DST
  142.                   15h:  DST
  143.                   16h:  SRC xor DST
  144.                   17h:  SRC or DST
  145.                   18h:  (not SRC) and (not DST)
  146.                   19h:  not (SRC xor DST)
  147.                   1Ah:  not DST
  148.                   1Bh:  SRC or (not DST)
  149.                   1Ch:  not SRC
  150.                   1Dh:  (not SRC) or DST
  151.                   1Eh:  (not SRC) or (not DST)
  152.                   1Fh:  One, all bits set
  153.    03h   BYTE    Background mix (same as above)
  154.  
  155. function 0Ah HSBCOL(X) - Set Background Color
  156.  Sets the background color
  157.  Parameter Block:
  158.  Offset: Type:   Description:
  159.    00h   WORD    Length of data following(4)
  160.    02h   DWORD   Background color index. Only the number of least significant
  161.                  bits (depending on the current mode) are used.
  162.                  0xFFFFFFFF is reserved for color fonts.
  163.  
  164. function 0Bh HSLT(X) - Set Line Type
  165.  Sets the current line type
  166.  Parameter Block:
  167.  Offset: Type:   Description:
  168.    00h   WORD    Length of data following(1 or 6)
  169.    02h   BYTE    Line pattern type
  170.                    0: User defined pattern (see byte 4-7)
  171.                    1: Dotted line (1 on, 2off)
  172.                    2: Short dashed line (5 on, 3 off)
  173.                    3: Dash-dot line (6 on, 4off, 2on, 4off)
  174.                    4: Double doted line (2 on, 4 off, 2 on, 8 off)
  175.                    5: Long dashed line (9 on, 3 off)
  176.                    6: Dash-double-dot line (8 on, 4 off, 2 on, 4 off, 2 on,
  177.                        4 off)
  178.                    7: Solid line
  179.                    8: Invisible line.
  180.        Following fields only present if length =6
  181.    03h   BYTE    Reserved
  182.    04h   DWORD   Address of user defined pattern
  183.                  Offset: Type:
  184.                    00h   WORD   Number of on/off byte pairs(N)
  185.                       ...
  186.                   2*N    BYTE   On count
  187.                   2*N+1  BYTE   Off count
  188.                  Maximum pattern length is 48 pixels.
  189.  
  190. function 0Ch HSLW(X) - Set Line Width
  191.  Sets the line drawing width
  192.  Parameter Block:
  193.  Offset: Type:   Description:
  194.    00h   WORD    Length of data following(1)
  195.    02h   BYTE    Line width in pixels. Original AI, ATI (Mach32) and XGA
  196.                  versions only supports widths of 1 and 3.
  197.  
  198. function 0Dh HEGS(X) - Erase Graphics Screen
  199.  Clears the screen and sets the current position to the top left corner
  200.  Parameter Block:
  201.  Offset: Type:   Description:
  202.    00h   WORD    Length of data following(0)
  203.  
  204. function 0Eh HSGQ(X) - Set Graphics Quality
  205.  Sets the graphics quality options
  206.  Parameter Block:
  207.  Offset: Type:   Description:
  208.    00h   WORD    Length of data following(2)
  209.    02h   WORD    Quality flags
  210.                  Bit  0-9  Reserved
  211.                        10  (XGA and ImageAdapter/A) If clear areas to be
  212.                             filled are closed by connection the first point
  213.                             to the last with a line
  214.                            Reserved in the original AI.
  215.                     11-12  0: Last pixel in a line is not drawn
  216.                            1: Last pixel in a line is drawn
  217.                            2: Last pixel in a line is drawn dependent on the
  218.                               mix mode.
  219.                        13  Reserved, set to 0
  220.                        14  0: High precision, 1: low precision
  221.                            Ignored in the XGA and ATI (Mach32) AI versions.
  222.                        15  Reserved, set to 0
  223.  
  224. function 0Fh HSCMP(X) - Set Color Comparison Register
  225.  Sets the color comparison information.
  226.  Parameter Block:
  227.  Offset: Type:   Description:
  228.    00h   WORD    Length of data following(5)
  229.    02h   DWORD   Comparison Color (CC)
  230.    06h   BYTE    Logic function:
  231.                    0:  TRUE
  232.                    1:  Destination >  CC
  233.                    2:  Destination == CC
  234.                    3:  Destination <  CC
  235.                    4:  FALSE
  236.                    5:  Destination >= CC
  237.                    6:  Destination != CC
  238.                    7:  Destination <= CC
  239.                  If the color comparison is true the pixel is left unmodified
  240.  
  241. function 10h HINT(X) - Interrupt
  242.  Waits until the event(s) specified by set bit(s) in the Event word happens
  243.  before it returns. Used to synchronize with an event.
  244.  Parameter Block:
  245.  Offset: Type:   Description:
  246.    00h   WORD    Length of data following(4)
  247.    02h   DWORD   Event/Interrupt bits:
  248.                    0-29  Reserved
  249.                      30  Wait for hardware to be free (I.e. not busy
  250.                          drawing). Only in the XGA version
  251.                      31  Wait for vertical blank.
  252.  
  253. function 11h HSPATTO(X) - Set Pattern Reference Point
  254.  Sets the pattern reference point for functions that use the pattern.
  255.  Parameter Block:
  256.  Offset: Type:   Description:
  257.    00h   WORD    Length of data following(4)
  258.    02h   WORD    X-coordinate
  259.    04h   WORD    X-coordinate
  260.  
  261. function 12h HSPATT(X) - Set Symbol Shape
  262.  Defines an area pattern
  263.  Parameter Block:
  264.  Offset: Type:   Description:
  265.    00h   WORD    Length of data following(10 or 14)
  266.    02h   BYTE    Cell width in pixels
  267.    03h   BYTE    Cell height in lines
  268.    04h   BYTE    Flags
  269.                  Bit 0-5  Reserved
  270.                        6  (XGA and ImageAdapter/A only) Set if pattern color
  271.                             data is in packed pixel format, clear if it always
  272.                             uses one byte per pixel
  273.                              0: 1pixel/byte, 1: packed pixel format
  274.                        7  0: Monochrome: Marker is drawn with current
  275.                              foreground color&mix on the background color&mix,
  276.                           1: Color: Marker is drawn in the color from the
  277.                              color data (Byte 0Ch) on the current background
  278.                              color&mix
  279.    05h   BYTE    Reserved
  280.    06h   WORD    Size of pattern in bytes
  281.    08h   DWORD   Ptr to pattern definition data. A packed monochrome bitmap
  282.        Following field only present if length = 14
  283.    0Ch   DWORD   Address of pattern color data
  284. Note: for the original AI (I.e. 8514/A hardware) the pattern is limited to
  285.       32x32, for the XGA and ImageAdapter/A versions there is no limit
  286.  
  287. function 13h HLDPAL(X) -Load Palette
  288.  Loads the color look-up table with either the default palette or a user
  289.  specified palette.
  290.  Parameter Block:
  291.  Offset: Type:   Description:
  292.    00h   WORD    Length of data following(1 or 10)
  293.    02h   BYTE    Palette type
  294.                    00h  User defined palette as specified in the remaining
  295.                         parameters
  296.                    01h  Adapter default palette. Ignore remaining parameters
  297.    03h   BYTE    Reserved
  298.    04h   WORD    Index of first palette entry
  299.    06h   WORD    Number of entries
  300.    08h   DWORD   Address of palette data. This consists of 4 bytes per entry,
  301.                  with the first byte (0) reserved, byte 1 is Green, byte 2 is
  302.                  Blue and byte 3 is Red.
  303.                  Note: one source has bytes 0 and 3 swapped ??
  304.  
  305. function 14h HSHS(X) - Set Scissors
  306.  Sets the scissors rectangle, if rectangle not specified (length=0) the HOPEN
  307.  default is used. Only pixels within the rectangle can be updated.
  308.  Parameter Block:
  309.  Offset: Type:   Description:
  310.    00h   WORD    Length of data following(0 or 8 (or 13 for XGA and
  311.                  ImageAdapter/A versions))
  312.        Following fields only present if length >=8
  313.    02h   WORD    Left limit (low X)
  314.    04h   WORD    Right limit (high X)
  315.    06h   WORD    Bottom limit (high Y)
  316.    08h   WORD    Top limit (low Y)
  317.        Following fields only present if length =13 (XGA and ImageAdapter/A)
  318.    0Ah   DWORD   Address of monochrome mask map. Only pixels with 1 in the
  319.                  mask map can be updated.
  320.    0Eh   BYTE    Reserved, must be 80h
  321.  
  322. function 15h HBBW(X) - BitBlt Write Image Data
  323.  Defines the screen area to be written by the HBBCBN command(s) following
  324.  Parameter Block:
  325.  Offset: Type:   Description:
  326.    00h   WORD    Length of data following(10 or 18)
  327.    02h   WORD    Type of BitBlt:
  328.                    0:  Writes a single plane. The source pattern is packed 8
  329.                        bits to a byte.
  330.                    1:  Writes all planes, the source data is packed.
  331.                        Only supported in XGA versions of the AI.
  332.                    8:  Writes all planes, source data has one pixel per byte
  333.    04h   WORD    Width of block in pixels
  334.    06h   WORD    Height of block in lines
  335.    08h   WORD    Source X coordinate - left
  336.    0Ah   WORD    Source Y coordinate - top
  337.  
  338.        The following fields are only present if the length is set to 18:
  339.        If set the destination buffer is defined as a rectangle and the data
  340.        is transferred to a rectangle within the buffer rectangle.
  341.  
  342.    0Ch   WORD    Offset of the destination rectangle from the left edge of
  343.                  the larger data buffer rectangle.
  344.    0Eh   WORD    Starting line in the data buffer
  345.    10h   WORD    Width of the data buffer in bytes
  346.    12h   WORD    Height of the data buffer in lines
  347.  
  348. function 16h HCBBW(X) - BitBlt Write Image Data at Current Position
  349.  Defines the screen area to be written by the HBBCBN command(s) following
  350.  Parameter Block:
  351.  Offset: Type:   Description:
  352.    00h   WORD    Length of data following(6 or 14)
  353.    02h   WORD    Type of BitBlt:
  354.                    0:  Writes a single plane. The source pattern is packed 8
  355.                        bits to a byte.
  356.                    1:  Writes all planes, the source data is packed.
  357.                        Only supported in XGA versions of the AI.
  358.                    8:  Writes all planes, source data has one pixel per byte
  359.    04h   WORD    Width of block in pixels
  360.    06h   WORD    Height of block in lines
  361.  
  362.        The following fields are only present if the length is set to 14:
  363.        If set the destination buffer is defined as a rectangle and the data
  364.        is transferred to a rectangle within the buffer rectangle.
  365.  
  366.    08h   WORD    Offset of the destination rectangle from the left edge of
  367.                  the larger data buffer rectangle.
  368.    0Ah   WORD    Starting line in the data buffer
  369.    0Ch   WORD    Width of the data buffer in bytes
  370.    0Eh   WORD    Height of the data buffer in lines
  371.  
  372. function 17h HBBR(X) - BitBlt Read image Data
  373.  Defines the screen area to be read by the HBBCBN command(s) following
  374.  Parameter Block:
  375.  Offset: Type:   Description:
  376.    00h   WORD    Length of data following(12 or 20)
  377.    02h   WORD    Type of BitBlt:
  378.                    0:  Reads a single plane. The plane is selected by byte 8
  379.                        The resulting bits are packed 8 to a byte.
  380.                    1:  Reads all planes, pack pixels as much as possible
  381.                        Only supported in XGA versions of the AI.
  382.                    8:  Reads all planes, one pixel per byte.
  383.    04h   WORD    Width of block in pixels
  384.    06h   WORD    Height of block in lines
  385.    08h   BYTE    Selects the source plane for single plane reads
  386.    09h   BYTE    Reserved
  387.    0Ah   WORD    Source X coordinate - left
  388.    0Ch   WORD    Source Y coordinate - top
  389.  
  390.        The following fields are only present if the length is set to 20:
  391.        If set the destination buffer is defined as a rectangle and the data
  392.        is transferred to a rectangle within the buffer rectangle.
  393.  
  394.    0Eh   WORD    Offset of the destination rectangle from the left edge of
  395.                  the larger data buffer rectangle.
  396.    10h   WORD    Starting line in the data buffer
  397.    12h   WORD    Width of the data buffer in bytes
  398.    14h   WORD    Height of the data buffer in lines
  399.  
  400. function 18h HBBCHN(X) - BitBlt Chained Data
  401.  Defines the data buffer used by a preceding HBBR, HBBW or HCBBW command
  402.  Parameter Block:
  403.  Offset:  Type:  Description:
  404.    00h    WORD   Length of data following(6)
  405.    02h    DWORD  Address of data buffer
  406.    06h    WORD   Number of bytes in buffer
  407. Note: Multiple buffers can be used to transfer a full image.
  408.  
  409. function 19h HBBC(X) - Bitblt Copy
  410.  Copies the source area to the destination area. Overlapping areas are
  411.  handled correctly.
  412.  Parameter Block:
  413.  Offset: Type:   Description:
  414.    00h   WORD    Length of data following(16)
  415.    02h   WORD    Type of Bitblt:
  416.                    0: Across-the-plane copying (color expansion).
  417.                       One plane (bit of each pixel - selected by Byte 8 of
  418.                       this record) holds the monochrome map which is
  419.                       expanded. Each 1 bit in the mono map causes the
  420.                       corresponding pixel in the destination to be written
  421.                       in the foreground color & mix, 0 bits causes writes
  422.                       in the background color & mix.
  423.                    8: Through-the-plane copying. The source is copied to
  424.                       the destination with the foreground mix.
  425.                  Note: one source claims 1 will also cause Through-the-plane
  426.                        copying like 8.
  427.    04h   WORD    Width of area
  428.    06h   WORD    Height of area
  429.    08h   BYTE    Source plane for bit expansion. For color expansions this
  430.                  selects the plane which holds the monochrome map.
  431.    09h   BYTE    Reserved
  432.    0Ah   WORD    Source X coordinate - left edge
  433.    0Ch   WORD    Source Y coordinate - top
  434.    0Eh   WORD    Source X coordinate - left edge
  435.    10h   WORD    Source Y coordinate - top
  436.  
  437. function 1Ah HSCOORD(X) - Set Coordinate Types
  438.  Sets the coordinate formats used.
  439.  Parameter Block:
  440.  Offset: Type:   Description:
  441.    00h   WORD    Length of data following(3)
  442.    02h   BYTE    Absolute coordinate format
  443.                  bit 0-3  Number of fractional bytes. Default = 0
  444.                      4-7  Number of bytes per coordinate. Default = 2
  445.    03h   BYTE    Relative coordinate format
  446.                  bit 0-3  Number of fractional bytes. Default = 0
  447.                      4-7  Number of bytes per coordinate. Default = 1
  448.    04h   BYTE    Number of dimensions: 2, 3 or 4
  449.  
  450. function 1Bh HQCOORD(X) - Query Coordinate Types
  451.  Informs whether specific coordinate formats are supported
  452.  Parameter Block:
  453.  Offset: Type:   Description:
  454.    00h   WORD    Length of data following(4)
  455.    02h   BYTE    Absolute coordinate format
  456.                  bit 0-3  Number of fractional bytes. Default = 0
  457.                      4-7  Number of bytes per coordinate. Default = 2
  458.    03h   BYTE    Relative coordinate format
  459.                  bit 0-3  Number of fractional bytes. Default = 0
  460.                      4-7  Number of bytes per coordinate. Default = 1
  461.    04h   BYTE    Number of dimensions. Only 2 supported
  462.    05h   BYTE    Returned test results
  463.                  bit 5  Set if specified dimension not supported
  464.                      6  Set if specified dimension not supported
  465.                      7  Set if specified dimension not supported
  466.  
  467. function 1Ch HSMODE(X) - Set Mode
  468.  Sets a new mode
  469.  Parameter Block:
  470.  Offset: Type:   Description:
  471.    00h   WORD    Length of data following(1, 2 for XGA or ImageAdapter/A)
  472.    02h   BYTE    Adapter mode number
  473.                    0:  1024x 768  with 12x20 char cell
  474.                    1:   640x 480  with  8x14 char cell
  475.                    2:  1024x 768  with  8x14 char cell
  476.                    3:  1024x 768  with  7x15 char cell
  477.                       Remaining in ATI versions only:
  478.                    8:   800x 600  with  8x14 char cell
  479.                   10:  1280x1024  with  7x15 char cell
  480.        Remaining field only present if length = 2:
  481.    03h   BYTE    Clear memory flag. 0: clear all memory, 80h don't clear
  482.  
  483. function 1Dh HQMODE(X) - Query Current Mode
  484.  Returns the current mode and configuration
  485.  Parameter Block:
  486.  Offset: Type:   Description:
  487.    00h   WORD    Length of data following(18, 20 for XGA or ImageAdapter/A)
  488.    02h   BYTE    Mode number.
  489.                   0: 1024x768, 12x20 char cell
  490.                   1:  640x480,  8x14 char cell
  491.                   2: 1024x768,  8x14 char cell
  492.                   3: 1024x768,  7x15 char cell
  493.    03h   WORD    Driver code level
  494.                  Bit 0-4  Release number (starts from 0)
  495.                        5  0: 4plane board, 1: 8plane board
  496.                        6  (8514/A) Minimum CPU level
  497.                             8086 or 80286 ?
  498.                      6-7  (XGA/Image Adapter) Minimum CPU level
  499.                             0: 80286, 1: 8086, 2: 80386
  500.                     8-11  (XGA/Image Adapter) Specification level
  501.                             0: level 1.0, 1: level 1.2, 2: level 2.0
  502.                    12-15  (XGA/Image Adapter) Operation system
  503.                             0: MS/PC-DOS
  504.  
  505.    05h   BYTE    Adapter Type.
  506.                   3: 8514/A, 4: XGA, 5: Image Adapter/A
  507.    06h   BYTE    Reserved
  508.    07h   BYTE    Text cell width in pixels
  509.    08h   BYTE    Text cell height in pixels
  510.    09h   BYTE    Number of planes
  511.    0Ah   WORD    Screen width in pixels
  512.    0Ch   WORD    Screen height in lines
  513.    0Eh   WORD    Pixels/inch - horizontally
  514.    10h   WORD    Pixels/inch - vertically
  515.                    59  for 640x480 on IBM 8514 monitor
  516.                    79  for 640x480 on IBM 8512 or 8513 monitor
  517.                    92  for 1024x768 on IBM 8514 monitor
  518.    12h   BYTE    00h for monochrome, 0FFh for color display
  519.    13h   BYTE    Intensity levels, I.e the number of bits the DAC can handle
  520.                  for each of the 3 basic colors.
  521.                    0: non-loadable palette
  522.                    6: original 8514/A and XGA
  523.                    8: XGA-NI
  524.  
  525.       Remaining fields only in XGA and Image Adapter/A version
  526.    14h   BYTE    Software area fill plane required (set to 1)
  527.    15h   BYTE    VGA mode support. 1 if a VGA compatible mode exists, 0 if not
  528.  
  529. function 1Eh HQMODES(X) - Query Adapter Modes
  530.  Returns a list of the supported modes, considering video memory and monitor
  531.  Parameter Block:
  532.  Offset: Type:   Description:
  533.    00h   WORD    Length of data following(33)
  534.    02h   BYTE    Adapter type
  535.    03h 32BYTEs   Mode list. Terminated by 0FFh.
  536.  
  537. function 1Fh HQDPS(X) - Query Drawing Process State Size
  538.  Returns the size of various structures
  539.  Parameter Block:
  540.  Offset: Type:   Description:
  541.    00h   WORD    Length of data following(6, 14 for XGA version)
  542.    02h   WORD    Task buffer size in bytes
  543.    04h   WORD    Stack usage in bytes
  544.    06h   WORD    Palette save buffer in bytes
  545.  
  546.       Remaining fields only in the XGA version
  547.    08h   DWORD   Amount of VRAM in bytes
  548.    0Ch   DWORD   Amount of VRAM (in bytes) required for area fill plane
  549.  
  550. function 20h HRECT(X) - Fill Rectangle
  551.  Fills a rectangle with the current area pattern
  552.  Parameter Block:
  553.  Offset: Type:   Description:
  554.    00h   WORD    Length of data following(8, 8*Number_of_rects for the
  555.                                          XGA and ImageAdapter/A versions)
  556.    02h   WORD    X-coordinate of top-left corner (top row)
  557.    04h   WORD    Y-coordinate of top-left corner (left edge)
  558.    06h   WORD    Width of the rectangle in pixels
  559.    08h   WORD    Height of the rectangle in lines
  560. Note: For the XGA and ImageAdapter/A versions the rectangle data (byte 2-9) is
  561.       repeated as many times as required by the length field.
  562.  
  563. function 21h HSBP(X) - Set Bit Plane Controls
  564.  Enables or disables specific planes. Each set bit enables the plane, each
  565.  clear bit disables it. Only the number of loworder bits from each field
  566.  relevant to the current mode are used, I.e 4 in 16color modes and 8 in
  567.  256color modes
  568.  Parameter Block:
  569.  Offset: Type:   Description:
  570.    00h   WORD    Length of data following(12, 26 for XGA and ImageAdapter/A)
  571.    02h   DWORD   Plane enable for graphics. Controls all writes to video
  572.                  memory for drawing and regular text operations
  573.    06h   DWORD   Plane enable for alphanumerics. Controls all writes to video
  574.                  memory for alphanumeric operations.
  575.    0Ah   DWORD   Plane enable for display. Controls which planes are displayed
  576.        Remaining fields only available in XGA and ImageAdapter/A versions
  577.    0Eh   BYTE    Flags, must be 0
  578.    0Fh   BYTE    Reserved(0)
  579.    10h   DWORD   Green bits mask
  580.    14h   DWORD   Red bits mask
  581.    18h   DWORD   Blue bits mask
  582.  
  583. function 22h HCLOSE(X) - Close Adapter
  584.  Closes down the AI and switches to VGA
  585.  Parameter Block:
  586.  Offset: Type:   Description:
  587.    00h   WORD    Length of data following(1)
  588.    02h   BYTE    Reserved, must be 0
  589. Note: one source claims the length is 0 rather than 1.
  590.  
  591. function 23h HESC(X) - Escape, Terminate Processing
  592.  Terminates any current drawing operation
  593.  Parameter Block:
  594.  Offset: Type:   Description:
  595.    00h   WORD    Length of data following(0)
  596. Note: this has no effect in the XGA version
  597.  
  598. function 24h HXLATE(X) - Assign Multi-Plane Text Color Index Table
  599.  Sets the color translation table for multiplane fonts.
  600.  Parameter Block:
  601.  Offset: Type:   Description:
  602.    00h   WORD    Length of data following(32)
  603.    02h  8 DWORDs Color translation table for multiplane fonts, which can have
  604.                   8 colors which are found by combining 1 bit from of 3 planes
  605.  
  606. function 25h HSCS(X) - Set Character Set
  607.  Sets the current character set
  608.  Parameter Block:
  609.  Offset: Type:   Description:
  610.    00h   WORD    Length of data following(4)
  611.    02h   DWORD   Ptr to font definition.
  612.                  This area should not be changed until HSCS is called again
  613.  
  614. function 26h HCHST(X) - Text Character String at Given Position
  615.  Writes a text string at the given (X,Y) position in the current font.
  616.  Parameter Block:
  617.  Offset: Type:   Description:
  618.    00h   WORD    Length of data following(4 + textlen)
  619.    02h   WORD    X-coordinate to plot text at
  620.    04h   WORD    Y-coordinate to plot text at
  621.    06h   TEXT    The text string. The number of characters is determined by
  622.                  the length in the WORD at 00h (-4).
  623.  
  624. function 27h HCCHST(X) - Text Character String at Current Position
  625.  Writes a text string at the current position in the current font.
  626.  Parameter Block:
  627.  Offset: Type:   Description:
  628.    00h   WORD    Length of data following(0 + textlen)
  629.    02h   TEXT    The text string. The number of characters is determined by
  630.                  the length in the WORD at 00h.
  631.  
  632. function 28h ABLOCKMFI(X) - Write Character Block
  633.  Writes a block of characters to the display
  634.  Parameter Block:
  635.  Offset: Type:   Description:
  636.    00h   WORD    Length of data following(9)
  637.    02h   BYTE    Start X position (column)
  638.    03h   BYTE    Start Y position (row)
  639.    04h   BYTE    Width of block in characters
  640.    05h   BYTE    Height of block in characters
  641.    06h   DWORD  Pointer to character block
  642.                  Each character occupies one DWORD:
  643.                  Bit   8-9  Font number
  644.                         12  Background transparent if set, opaque if clear
  645.                         13  Overstrike
  646.                         14  Reverse Video
  647.                         15  Underscore
  648.                      16-19  Foreground color
  649.                      20-23  Background color
  650.                      24-31  Character code
  651.    0Ah   BYTE    Number of characters in block
  652.  
  653. function 29h ABLOCKCGA(X) - Write Character Block (CGA)
  654.  Writes a block of characters to the display
  655.  Parameter Block:
  656.  Offset: Type:   Description:
  657.    00h   WORD    Length of data following(10)
  658.    02h   BYTE    Start X position (column)
  659.    03h   BYTE    Start Y position (row)
  660.    04h   BYTE    Width of block in characters
  661.    05h   BYTE    Height of block in characters
  662.    06h   DWORD   Pointer to character block
  663.                  Each character occupies one WORD:
  664.                  Bit 0-3  Foreground color
  665.                      4-7  Background color
  666.                     8-15  Character code
  667.    0Ah   BYTE    Number of characters in block
  668.    0Bh   BYTE    Attribute of the text
  669.                  Bit 0-1  Font selection
  670.                        4  Set for transparent background, clear for opaque
  671.                           background (use characters background color)
  672.                        5  Overstrike
  673.                        6  Reverse Video
  674.                        7  Underline
  675.  
  676. function 2Ah AERASE(X) - Erase Rectangle
  677.  Clears a rectangle to the specified background color
  678.  Parameter Block:
  679.  Offset: Type:   Description:
  680.    00h   WORD    Length of data following(5)
  681.    02h   BYTE    Starting column
  682.    03h   BYTE    Starting Row
  683.    04h   BYTE    Number of Columns
  684.    05h   BYTE    Number of Rows
  685.    06h   BYTE    Bits 0-3  Reserved, should be 0
  686.                       4-7  Background color
  687.  
  688. function 2Bh ASCROLL(X) - Scroll Rectangle
  689.  Scrolls a rectangle of character cells
  690.  Parameter Block:
  691.  Offset: Type:   Description:
  692.    00h   WORD    Length of data following(6)
  693.    02h   BYTE    Starting character column of source
  694.    03h   BYTE    Starting character row of source
  695.    04h   BYTE    Number of character columns of area
  696.    05h   BYTE    Number of character rows of area
  697.    06h   BYTE    Starting character column of destination
  698.    07h   BYTE    Starting character row of destination
  699. Note: both source and destination must be entirely on screen
  700.  
  701. function 2Ch ACURSOR(X) - Set Cursor Position
  702.  Moves the text-cursor
  703.  Parameter Block:
  704.  Offset: Type:   Description:
  705.    00h   WORD    Length of data following(2)
  706.    02h   BYTE    New X position in character Columns
  707.    03h   BYTE    New Y position in character Rows
  708.  
  709. function 2Dh ASCUR(X) - Set Cursor Shape
  710.  Sets the shape of the text cursor
  711.  Parameter Block:
  712.  Offset: Type:   Description:
  713.    00h   WORD    Length of data following(3)
  714.    02h   BYTE    Cursor start line. 0=top
  715.    03h   BYTE    Cursor stop line
  716.    04h   BYTE    Cursor Attributes
  717.                   00h  Normal cursor
  718.                   01h  Hidden cursor
  719.                   02h  Left arrow cursor
  720.                   03h  Right arrow cursor
  721.  
  722. function 2Eh ASFONT(X) - Set Character Set
  723.  Defines the character set
  724.  Parameter Block:
  725.  Offset: Type:   Description:
  726.    00h   WORD    Length of data following(6)
  727.    02h   BYTE    Font number
  728.    03h   BYTE    Reserved
  729.    04h   DWORD   Address of the character set definition block:
  730.                  Offset: Type:  Description:
  731.                    00h   BYTE   Reserved
  732.                    01h   BYTE   Type of character set
  733.                                  00h  Bitmapped
  734.                                  03h  Short stroke vector
  735.                    02h   BYTE   Reserved
  736.                    03h   DWORD  Reserved
  737.                    07h   BYTE   Cell width in pixels
  738.                    08h   BYTE   Cell height in pixels
  739.                    09h   BYTE   Reserved
  740.                    0Ah   WORD   Cell size (height*width/8 rounded up to
  741.                                 nearest number of bytes).
  742.                    0Ch   WORD   Flags
  743.                                 Bit 13  Set for proportionally spaced font
  744.                                     14  Set for color bitmapped fonts,
  745.                                         clear for mono bitmapped fonts
  746.                                 Other bits must be 0.
  747.                    0Eh   DWORD  Address of index table. One WORD for each
  748.                                 character code (see Initial and Final
  749.                                 codes in bytes 16h and 17h). Marks the
  750.                                 start of each character definition
  751.                                 (bitmap/stroked line) relative to the
  752.                                 start of the character definition table.
  753.                    12h   DWORD  Address of character width table
  754.                                 Two bytes per character code. The first is
  755.                                 the indention in pixels from the left, the
  756.                                 second the indention in pixels from the
  757.                                 right, thus non-zero values makes the
  758.                                 character thinner.
  759.                                 Only used for proportionally spaced fonts
  760.                    16h   BYTE   Initial code point. First character code
  761.                                 in the font tables.
  762.                    17h   BYTE   Final code point. Last character code in the
  763.                                 font tables.
  764.                    18h   DWORD  Address of character definition table. For
  765.                                 bitmapped fonts each character is defined
  766.                                 as a two-dimensional array of bits
  767.                                 occupying the minimum number of bytes per
  768.                                 character, I.e. an 11x9 font occupies 13
  769.                                 bytes. For Short Stroke vector fonts each
  770.                                 character is defined by a series of
  771.                                 draw/move commands each occupying one
  772.                                 byte, terminated by a null (00h) byte.
  773.                                 Each command byte is defined as:
  774.                                 Bit 0-3  Length in pixels projected onto the
  775.                                          X or Y axis
  776.                                       4  Clear for move, set for draw
  777.                                     5-7  Direction
  778.                                           0:   0 degrees (increasing X)
  779.                                           1:  45 degrees
  780.                                           2:  90 degrees (increasing Y)
  781.                                           3: 135 degrees
  782.                                           4: 180 degrees (decreasing X)
  783.                                           5: 225 degrees
  784.                                           6: 270 degrees (decreasing Y)
  785.                                           7: 315 degrees
  786.                    1Ch   WORD   Reserved
  787.                    1Eh   DWORD  Address of 2nd character table
  788.                                 For Color Bitmapped Fonts where the
  789.                                 foreground color is NOT FFFFFFFFh this table
  790.                                 and the 3rd character table are ORed with the
  791.                                 primary character definition table to
  792.                                 produce one table. The image is drawn with
  793.                                 the current foreground color and mix on the
  794.                                 current background color and mix.
  795.                    22h   WORD   Reserved
  796.                    24h   DWORD  Address of 3rd character table. See the
  797.                                 description under the 2nd char table.
  798.  
  799. function 2Fh AXLATE(X) - Assign Alpha Attribute Color Index Table
  800.  Defines character attribute to color translations.
  801.  Parameter Block:
  802.  Offset: Type:   Description:
  803.    00h   WORD    Length of data following(128)
  804.    02h 16DWORDs  Foreground Character Attribute (bits 4-7) translation
  805.                  table. One DWORD for each of 16 attribute combinations
  806.    42h 16DWORDs  Background Character Attribute (bits 0-3) translation
  807.                  table. One DWORD for each of 16 attribute combinations
  808.  
  809. function 30h HINIT(X) - Initialize State
  810.  Sets the Task State buffer to the adapter dependent initial state
  811.  Parameter Block:
  812.  Offset: Type:   Description:
  813.    00h   WORD    Length of data following(2)
  814.    02h   WORD    Segment address of the Task State buffer, offset is 0.
  815.  
  816. function 31h HSYNC(X) - Synchronize Adapter
  817.  Sets the adapter state to the state store in the specified task buffer.
  818.  Used to implement task switching in a multi-tasking environment
  819.  Parameter Block:
  820.  Offset: Type:   Description:
  821.    00h   WORD    Length of data following(2)
  822.    02h   WORD    Segment of the Task state buffer
  823.  
  824. function 32h HMRK(X) - Marker at Given Position
  825.  Places a marker symbol at each position given.
  826.  Parameter Block:
  827.  Offset: Type:   Description:
  828.    00h   WORD    Length of data following(4*Number_of_points)
  829.        ...
  830.   4*N+2  WORD    X-coordinate of Nth point
  831.   4*N+4  WORD    Y-coordinate of Nth point
  832.  
  833. function 33h HCMRK(X) - Marker at Current Position
  834.  Draws a marker (defined by HSMARK) at the current position and each point in
  835.  the data block. The marker is drawn around the point.
  836.  Parameter Block:
  837.  Offset: Type:   Description:
  838.    00h   WORD    Length of data following(4*Number_of_points)
  839.        ...
  840.   4*N+2  WORD    X-coordinate of Nth point
  841.   4*N+4  WORD    Y-coordinate of Nth point
  842.  
  843. function 34h HSMARK(X) - Set Marker Shape
  844.  Sets the shape of the marker symbol
  845.  Parameter Block:
  846.  Offset: Type:   Description:
  847.    00h   WORD    Length of data following(10 or 14)
  848.    02h   BYTE    Mark width in pixels
  849.    03h   BYTE    Mark height in lines
  850.    04h   BYTE    Flags
  851.                  Bit 0-5  Reserved, set to 0
  852.                        6  (XGA and ImageAdapter/A only) For color data:
  853.                              0: 1pixel/byte, 1: packed pixel format
  854.                        7  0: Monochrome: Marker is drawn with current
  855.                              foreground color&mix on the background color&mix,
  856.                           1: Color: Marker is drawn in the color from the
  857.                              color data (Byte 0Ch) on the current background
  858.                              color&mix
  859.    05h   BYTE    Reserved
  860.    06h   WORD    Size of mark definition data
  861.    08h   DWORD   Address of mark definition. A packed monochrome bitmap
  862.        This field only present if length = 14
  863.    0Ch   DWORD   Address of mark color data. Either one pixel/byte or packed
  864.                  pixel data if byte 4 bit 6 set.
  865.  
  866. function 35h HSLPC(X) - Save Line Pattern Count
  867.  Saves the line pattern count.
  868.  Parameter Block:
  869.  Offset: Type:   Description:
  870.    00h   WORD    Length of data following(0, 2 for XGA and ImageAdapter/A)
  871.        The following field only present if length=2 (XGA and ImageAdapter/A)
  872.    02h   WORD    Line pattern count stored in this word.
  873.  
  874. function 36h HRLPC(X) - Restore Line Pattern Count
  875.  Restores a previously saved line pattern count.
  876.  Parameter Block:
  877.  Offset: Type:   Description:
  878.    00h   WORD    Length of data following(0, 2 for XGA and ImageAdapter/A)
  879.    02h   WORD    Optional line pattern count to use for restore
  880.                  Only present for XGA and ImageAdapter/A versions
  881.  
  882. function 37h HQCP(X) - Query Current Position
  883.  Returns the current position
  884.  Parameter Block:
  885.  Offset: Type:   Description:
  886.    00h   WORD    Length of data following(4)
  887.    02h   WORD    Current X coordinate
  888.    04h   WORD    Current Y coordinate
  889.  
  890. function 38h HQDFPAL(X) - Query Default Palette
  891.  Returns the default palette RGB values
  892.  Parameter Block:
  893.  Offset: Type:   Description:
  894.    00h   WORD    Length of data following(64)
  895.    02h  16DWORDs One DWORD for each of the 16 primary color indices with the
  896.                  RGB value currently in use for that index.
  897.                  Primary colors:
  898.                   0: Black    1: Blue          2: Green,      3: Cyan
  899.                   4: Red      5: Magenta       6: Brown       7: White
  900.                   8: Grey     9: Lt Blue      10: Lt Green   11: Lt Cyan
  901.                  12: Lt Red  13: Lt Magenta   14: Yellow     15: Bright White
  902.  
  903. function 39h HSPAL(X) - Save Palette
  904.  Saves the palette in a format ready for loading with HRPAL
  905.  Parameter Block:
  906.  Offset: Type:   Description:
  907.    00h   WORD    Length of data following(get from HQDPS)
  908.    02h   BYTEs   Palette buffer, get size from HQDPS
  909.  
  910. function 3Ah HRPAL(X) - Restore Palette
  911.  Restores a previously saved palette
  912.  Parameter Block:
  913.  Offset: Type:   Description:
  914.    00h   WORD    Length of data following(up to 768)
  915.    02h 768BYTEs  Palette data, up to 256 * 3BYTEs, see HQDPS for exact size
  916.  
  917. function 3Bh HSAFP(X) -
  918.  Sets the area fill plane for areafill, raster text and marker operation.
  919.  Only needed if the default bitmap has been changed with HSBMAP.
  920.  Parameter Block:
  921.  Offset: Type:   Description:
  922.    00h   WORD    Length of data following(5)
  923.    02h   DWORD   Address of area fill plane. Linear offset into the video
  924.                  memory, must be a multiple of 4.
  925.    06h   BYTE    Reserved, must be 80h
  926. Note: this function only implemented in the XGA and Image Adapter/A versions
  927.  
  928. function 3Ch ASCELL(X)
  929.  Resizes the alphanumeric cell size. A new font should be loaded before text
  930.  is output again.
  931.  Parameter Block:
  932.  Offset: Type:   Description:
  933.    00h   WORD    Length of data following(2)
  934.    02h   BYTE    New cell width
  935.    03h   BYTE    New cell height
  936.  
  937. function 3Dh ASGO(X)
  938.  Sets the origin for text output.
  939.  Parameter Block:
  940.  Offset: Type:   Description:
  941.    00h   WORD    Length of data following(4)
  942.    02h   WORD    New X-position of grid origin
  943.    04h   WORD    New Y-position of grid origin
  944. Note: this function only implemented in the XGA and Image Adapter/A versions
  945.  
  946. function 3Eh HDLINE(X) -
  947.  Draws a series of lines, from point 1 to 2, then from point 3 to 4 etc.
  948.  The current position is set to the last point in the list, which may either
  949.  be the endpoint of a line (even number of points) or a separate point.
  950.  Parameter Block:
  951.  Offset: Type:   Description:
  952.    00h   WORD    Length of data following(4*Number_of_points)
  953.        ...
  954.   4*N+2  WORD    X-coordinate of the Nth point
  955.   4*N+4  WORD    Y-coordinate of the Nth point
  956. Note: this function only implemented in the XGA and Image Adapter/A versions
  957.  
  958. function 40h HPEL(X) -
  959.  Draws horizontal strings of pixels using the current color and mix
  960.  Parameter Block:
  961.  Offset: Type:   Description:
  962.    00h   WORD    Length of data following(6*Number_of_strings)
  963.         ...
  964.   6*N+2  WORD    X-coordinate (leftmost) of the Nth string
  965.   6*N+4  WORD    Y-coordinate of the Nth string
  966.   6*N+6  WORD    Number of pixels in the Nth string
  967. Note: this function only implemented in the XGA and Image Adapter/A versions
  968.  
  969. function 41h HRPEL(X) -
  970.  Reads the requested number of pixels from (X,Y) leftwards and places the
  971.  read pixels in the data buffer in packed format.
  972.  Parameter Block:
  973.  Offset: Type:   Description:
  974.    00h   WORD    Length of data following(10)
  975.    02h   DWORD   Ptr to pixel buffer
  976.    06h   WORD    X-coordinate
  977.    08h   WORD    Y-coordinate
  978.    0Ah   WORD    Pixel count
  979. Note: this function only implemented in the XGA and Image Adapter/A versions
  980.  
  981. function 42h HPSTEP(X) -
  982.  Draws  a series of short stroke commands at the given position
  983.  Parameter Block:
  984.  Offset: Type:   Description:
  985.    00h   WORD    Length of data following(8 or 12)
  986.    02h   WORD    X-coordinate of start point
  987.    04h   WORD    Y-coordinate of start point
  988.    08h   DWORD   Address of Short Stroke-style data.
  989.                  Each byte is a 8514 style Short-Stroke vector:
  990.                  Bit 0-3  Length of linesegment in pixels
  991.                        4  1 for draw, 0 for move
  992.                      5-7  Direction in degrees counter-clockwise from X-axis
  993.                             0:  0 deg, 1: 45 deg, 2: 90 deg, 3: 135deg
  994.                             4: 180deg, 5: 225deg, 6: 270deg, 7: 315deg
  995.                  A null byte terminates the data block.
  996.    0Ch   DWORD   Address of source pixel buffer (only present if the length
  997.                  field is 12). If present each pixel drawn (or skipped) gets
  998.                  its colorinfo from this buffer, rather than the foreground
  999.                  color & mix.
  1000. Note: this function only implemented in the XGA and Image Adapter/A versions
  1001.  
  1002. function 43h HCPSTEP(X)
  1003.  Draws a series of shortstroke linesegments.
  1004.  Parameter Block:
  1005.  Offset: Type:   Description:
  1006.    00h   WORD    Length of data following(4 or 8)
  1007.    02h   DWORD   Address of Short Stroke-style data.
  1008.                  Each byte is a 8514 style Short-Stroke vector:
  1009.                  Bit 0-3  Length of linesegment in pixels
  1010.                        4  1 for draw, 0 for move
  1011.                      5-7  Direction in degrees counter-clockwise from X-axis
  1012.                             0:  0 deg, 1: 45 deg, 2: 90 deg, 3: 135deg
  1013.                             4: 180deg, 5: 225deg, 6: 270deg, 7: 315deg
  1014.                  A null byte terminates the data block.
  1015.    06h   DWORD   Address of source pixel buffer (only present if the length
  1016.                  field is 8). If present each pixel drawn (or skipped) gets
  1017.                  its colorinfo from this buffer, rather than the foreground
  1018.                  color & mix.
  1019. Note: this function only implemented in the XGA and Image Adapter/A versions
  1020.  
  1021. function 44h HRSTEP(X) -
  1022.  Reads pixel data along a series of short stroke vectors from the given point
  1023.  Parameter Block:
  1024.  Offset: Type:   Description:
  1025.    00h   WORD    Length of data following(12)
  1026.    02h   WORD    Starting X-coordinate
  1027.    04h   WORD    Starting Y-coordinate
  1028.    06h   DWORD   Address of Short Stroke-style data.
  1029.                  Each byte is a 8514 style Short-Stroke vector:
  1030.                  Bit 0-3  Length of linesegment in pixels
  1031.                        4  1 for draw, 0 for move
  1032.                      5-7  Direction in degrees counter-clockwise from X-axis
  1033.                             0:  0 deg, 1: 45 deg, 2: 90 deg, 3: 135deg
  1034.                             4: 180deg, 5: 225deg, 6: 270deg, 7: 315deg
  1035.                  A null byte terminates the data block.
  1036.    0Ah   DWORD   Ptr to buffer where read pixels are placed in packed format
  1037. Note: this function only implemented in the XGA and Image Adapter/A versions
  1038.  
  1039. function 45h HSBMAP(X) -
  1040.  Sets current bitmap and attributes.
  1041.  Parameter Block:
  1042.  Offset: Type:   Description:
  1043.    00h   WORD    Length of data following(10)
  1044.    02h   BYTE    Flags
  1045.                  Bit 0-5  Reserved, must be 0
  1046.                        6  1 for screen bitmaps, 0 for non-screen bitmaps
  1047.                        7  Reserved, must be 1
  1048.    03h   BYTE    Bitmap depth: 1, 2, 4 or 8
  1049.    04h   DWORD   Address of bitmap, as a linear offset from the start of the
  1050.                  display memory of the device. Must be a multiple of 8 bytes
  1051.                  for screen bitmaps and of 4 bytes for non-screen bitmaps.
  1052.    08h   WORD    Width of bitmap in pixels. Max 2048 pixels
  1053.                  Must be a multiple of 8 bytes for screen bitmaps and of 4
  1054.                  bytes for non-screen bitmaps.
  1055.    0Ah   WORD    Height of bitmap in lines. Max 2048 lines
  1056.  
  1057. function 46h HQBMAP(X) -
  1058.  Queries current bitmap attributes
  1059.  Parameter Block:
  1060.  Offset: Type:   Description:
  1061.    00h   WORD    Length of data following(10 or 18)
  1062.    02h   BYTE    Flags
  1063.                  Bit 0-5  Reserved, must be 0
  1064.                        6  Set for Screen bitmap, clear for non-screen
  1065.                        7  Reserved, must be 1
  1066.    03h   BYTE    Bitmap depth (1,2,4 or 8)
  1067.    04h   DWORD   Address of bitmap as linear offset from the start of the
  1068.                  frame buffer.
  1069.    08h   WORD    Width of bitmap in pixels
  1070.    0Ah   WORD    Height of bitmap in lines
  1071.  
  1072.       Remaining fields only present if the length field is 18
  1073.    0Ch   WORD    Display window X origin
  1074.    0Eh   WORD    Display window Y origin
  1075.    10h   WORD    Display window width in pixels
  1076.    12h   WORD    Display window height in lines
  1077. Note: this function only implemented in the XGA and Image Adapter/A versions
  1078.  
  1079. function 47h HBMC(X) -
  1080.  Copies bitmap block data, either within a bitmap or between bitmaps
  1081.  Parameter Block:
  1082.  Offset: Type:   Description:
  1083.    00h   WORD    Length of data following(48)
  1084.    02h   WORD    Flags
  1085.                  Bit    9  If set the source bitmap starts (logically) at
  1086.                            the bottom-left corner rather than the top-left
  1087.                     10-11  Location of pattern bitmap
  1088.                              0: pattern not present
  1089.                              2: Video RAM
  1090.                     12-13  Location of source bitmap
  1091.                              0: Source not present (use pattern instead).
  1092.                              2: Video RAM
  1093.                     14-15  Location of destination bitmap
  1094.                              2: Video RAM
  1095.    04h   WORD    Width of block in pixels
  1096.    06h   WORD    Height of block in lines
  1097.    08h   BYTE    Destination bitmap depth
  1098.    09h   BYTE    Reserved
  1099.    0Ah   DWORD   Address of destination bitmap
  1100.    0Eh   WORD    Pitch of destination in pixels
  1101.    10h   WORD    Height of destination map in lines
  1102.    12h   WORD    Destination X-coordinate
  1103.    14h   WORD    Destination Y-coordinate
  1104.    16h   BYTE    Source bitmap depth. 1,2 or 8
  1105.    17h   BYTE    Reserved
  1106.    18h   DWORD   Address of source bitmap
  1107.    1Ch   WORD    Pitch of source bitmap
  1108.    1Eh   WORD    Height of source bitmap
  1109.    20h   WORD    Source X-coordinate
  1110.    22h   WORD    Source Y-coordinate
  1111.    24h   BYTE    Pattern bitmap depth. 1
  1112.    25h   BYTE    Reserved
  1113.    26h   DWORD   Address of pattern bitmap
  1114.    2Ah   WORD    Pitch of pattern bitmap
  1115.    2Ch   WORD    Height of pattern bitmap
  1116.    2Eh   WORD    X-position of pattern within pattern bitmap
  1117.    30h   WORD    Y-position of pattern within pattern bitmap
  1118. Note: this function only implemented in the XGA and Image Adapter/A versions
  1119.  
  1120. function 48h HSDW(X) -
  1121.  Sets the display window
  1122.  Parameter Block:
  1123.  Offset: Type:   Description:
  1124.    00h   WORD    Length of data following(8)
  1125.    02h   WORD    New X-origin for display window
  1126.    04h   WORD    New Y-origin for display window
  1127.    06h   WORD    Window width in pixels
  1128.    08h   WORD    Window height in lines
  1129. Note: this function only implemented in the XGA and Image Adapter/A versions
  1130.  
  1131. function 49h HSPRITE(X) -
  1132.  Positions the Hardware Sprite
  1133.  Parameter Block:
  1134.  Offset: Type:   Description:
  1135.    00h   WORD    Length of data following(4)
  1136.    02h   WORD    New sprite hot-spot X-coordinate
  1137.    04h   WORD    New sprite hot-spot Y-coordinate
  1138. Note: this function only implemented in the XGA version
  1139.  
  1140. function 4Ah HSSPRITE(X)
  1141.  Defines and enables/disables the hardware sprite.
  1142.  Parameter Block:
  1143.  Offset: Type:   Description:
  1144.    00h   WORD    Length of data following(1 or 24)
  1145.    02h   BYTE    Flags
  1146.                  Bit 0-6  Reserved
  1147.                        7  0: Disabled, 1: Enabled and visible
  1148.       Remaining fields only present if length=24
  1149.    03h   BYTE    Reserved, set to 0
  1150.    04h   BYTE    X hot-spot offset
  1151.    05h   BYTE    Y hot-spot offset
  1152.    06h   DWORD   Ptr to sprite definition data.
  1153.                  A 2bits per pixel packed bitmap, where each pixels indicates:
  1154.                    0:  Sprite Color 0
  1155.                    1:  Sprite Color 1
  1156.                    2:  Transparent (Screen data)
  1157.                    3:  Inverse screen data (XOR cursor)
  1158.    0Ah   WORD    Sprite width in pixels. Must be a multipla of 4. Max 64.
  1159.    0Ch   WORD    Sprite height in lines. Max 64.
  1160.    0Eh   WORD    Color 0, red component
  1161.    10h   WORD    Color 0, green component
  1162.    12h   WORD    Color 0, blue component
  1163.    14h   WORD    Color 1, red component
  1164.    16h   WORD    Color 1, green component
  1165.    18h   WORD    Color 1, blue component
  1166. Note: this function only implemented in the XGA version
  1167.  
  1168. function 4Bh HRWVEC(X) -
  1169.  Either draws a polyline from the data in the pixel buffer, or copies the
  1170.  pixels under the polyline into the pixel buffer. The polyline starts with the
  1171.  coordinates in WORDs 8 and 0Ah and continues to each coordinate set in turn.
  1172.  Parameter Block:
  1173.  Offset: Type:   Description:
  1174.    00h   WORD    Length of data following(10+4*Number_of_points)
  1175.    02h   BYTE    Flags
  1176.                  Bit 0-6  Reserved(0)
  1177.                        7  Set to write data, clear to read
  1178.    03h   BYTE    Reserved(0)
  1179.    04h   DWORD   Address of data buffer. For reads the data under the polyline
  1180.                  is stored in this buffer in packed format, for writes each
  1181.                  pixel in the buffer decides the mix to use for drawing the
  1182.                  corresponding pixel of the polyline. 0 causes the pixel to be
  1183.                  drawn with the background, all other values causes the pixel
  1184.                  to be drawn with the foreground mix.
  1185.                  The buffer is max 4095 bytes
  1186.    08h   WORD    Starting X-coordinate
  1187.    0Ah   WORD    Starting Y-coordinate
  1188.  
  1189.  4*N+8   WORD    X-coordinate of Nth point
  1190.  4*N+10  WORD    Y-coordinate of Nth point
  1191.  
  1192. Note: this function only implemented in the XGA and Image Adapter/A versions
  1193.  
  1194. function 4Eh HSFPAL(X) -
  1195.  Saves full palette
  1196.  Parameter Block:
  1197.  Offset: Type:   Description:
  1198.    00h   WORD    Length of data following(Get size from HQDPS)
  1199.    02h   WORD    Format, always 8
  1200.      Palette data follows. Call HQDPS for size of palette data.
  1201.  
  1202. function 4Fh HRFPAL(X) -
  1203.  Restores full palette. The size of the data area should be taken from HQDPS
  1204.  Parameter Block:
  1205.  Offset: Type:   Description:
  1206.    00h   WORD    Length of data following(size of palette data +1)
  1207.    02h   WORD    Format (8)
  1208.   04h-   BYTEs   Palette data. See HQDPS for size
  1209. Note: this function only implemented in the XGA and Image Adapter/A versions
  1210.  
  1211. function 50h HQDEVICE(X)
  1212.  Returns device specific information
  1213. Note: this function only implemented in the Image Adapter/A version
  1214.  
  1215.  
  1216. Check for AI installed:
  1217.  
  1218.   if MEML[0:$1FC]<>0 then     {Int Vector 7Fh not NULL}
  1219.   begin
  1220.     rp.cx:=0;
  1221.     rp.dx:=0;
  1222.     rp.ax:=$105;
  1223.     intr($7F,rp);
  1224.     if ((rp.flags and 1)=0)                 {Carry not set}
  1225.       and ((rp.cx<>0) or (rp.dx<>0) then    {CX:DX is non-zero}
  1226.         We have an AI. CX:DX points to the jump table
  1227.   end;
  1228.  
  1229.